package org.hishenframework.core.data.jdbc.template.oracle;

import java.util.List;
import java.util.Map;

import org.hishenframework.core.data.jdbc.template.AbstractHishenJdbcTemplate;

public class OracleHishenJdbcTemplate<T> extends AbstractHishenJdbcTemplate<T>{

	@Override
	public List<T> queryForListBean(long offset, long length, String sql, Class<T> entityClass, Object... values) {
		sql += " limit " + offset + ", " + length;
		return super.queryForListBean(sql, entityClass, values);
	}

	@Override
	public List<Map<String, Object>> queryForListMap(long offset, long length, String sql, Object... values) {
		sql += " limit " + offset + ", " + length;
		return super.queryForListMap(sql, values);
	}

	@Override
	public long queryForCount(String sql, Object... values) {
		sql = "SELECT COUNT(*) FROM (" + sql + ") t";
		return super.queryForLong(sql, values);
	}

}
